package com.litian.dancechar.framework.common.thread;

import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 自定义线程池
 *
 * @author litian
 * @date 2021/6/14 22:28
 */
@Component
public class CustomThreadPoolTaskExecutor {
    @Resource
    private ThreadPoolCreate threadPoolCreate;

    public ThreadPoolTaskExecutor newFixedThreadPool(Integer nThreads) {
        return threadPoolCreate.getTaskExecutor(nThreads);
    }
}